<template>
  <div>
    <div class="login-bd phone-bd">
      <div>
        <input type="text" placeholder="请输入手机号码" id="phone" class="ipt" />
      </div>
      <div v-if="CodeOrPwd">
        <input type="password" placeholder="请输入密码" id="pwd" class="ipt" />
      </div>
      <div class="code-wrap" v-else>
        <input type="text" placeholder="请输入验证码" id="code" class="ipt" />
        <a href="javascript:;" class="u-btn2 get-code"><i class="u-btn2">获取验证码</i></a>
      </div>
      <div class="note">
        <div class="change">
          <a href="javascript:;" @click="CodeOrPwd = !CodeOrPwd">{{
            CodeOrPwd ? '短信登录' : '密码登录'
          }}</a>
        </div>
        <div class="auto">
          <input type="checkbox" name="auto" id="" /><label for="auto">自动登录</label>
        </div>
      </div>
      <a href="javascript:;" @click="$Message({ msg: '功能未开发' })" class="u-btn2 login-btn"
        ><div class="u-btn2">登录</div></a
      >
    </div>
    <div class="footer">
      <a href="javascript:;" @click="$parent.loginMethod = 'other'" class="to-other">&lt; 其他登录方式</a>
      <a href="javascript:;" @click="$Message({ msg: '功能未开发' })" class="to-register"
        >&lt; 没有帐号？免费注册</a
      >
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 手机登录采用密码或者验证码
      CodeOrPwd: true
    }
  }
}
</script>

<style lang="less" scoped>
.login-bd {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-content: center;
  margin: 20px 0;
  width: 100%;
  height: 270px;
}
.phone-bd {
  margin: 0 auto;
  padding: 30px 0 43px;
  width: 220px;
  height: 224px;
  .ipt {
    position: relative;
    margin: 0;
    width: 100%;
    height: 30px;
    line-height: 30px;
    padding-left: 10px;
    border: 1px solid #cdcdcd;
    border-radius: 2px;
    z-index: 11;
  }
  .note {
    display: flex;
    justify-content: space-between;
    align-items: center;
    .auto {
      input {
        vertical-align: middle;
      }
    }
  }
}
.phone-bd {
  .code-wrap {
    display: flex;
    justify-content: space-between;
    #code {
      width: 136px;
    }
    .get-code {
      display: inline-block;
      padding: 0 5px 0 0;
      width: 70px;
      height: 31px;
      line-height: 31px;
      color: #333;
      overflow: hidden;
      vertical-align: top;
      text-align: center;
      white-space: nowrap;
      background-position: right -100px;
      box-sizing: content-box;
      i {
        display: inline-block;
        width: 61px;
        padding: 0 2px 0 7px;
        background-position: 0 -59px;
        box-sizing: content-box;
      }
    }
  }
}
</style>
